home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14578 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: mail2news.demon.co.uk!willen.demon.co.uk
  2. From: Adrian Parker <adrian@willen.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: big endian, little endian
  5. Date: Mon, 15 Apr 96 23:04:03 GMT
  6. Organization: Quondam Ltd
  7. Message-ID: <829609443snz@willen.demon.co.uk>
  8. References: <4ku9dm$t1t@news.ycc.yale.edu>
  9. Reply-To: adrian@willen.demon.co.uk
  10. X-NNTP-Posting-Host: willen.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.30
  12. X-Mail2News-Path: willen.demon.co.uk
  13.  
  14. In article <4ku9dm$t1t@news.ycc.yale.edu>
  15.            rmurphy@minerva.cis.yale.edu "rmurphy" writes:
  16.  
  17. > Hi.  I'm a graduate student doing research in computer music, and i
  18. > have a small tech question I can't seem to get answered in the c
  19. > reference books.  What is the difference between big-endian and
  20. > little-endian?  I know it relates somehow to signed/unsigned integers,
  21. > and the division between ibm & 68k-based platforms, but have no clue
  22. > beyond that.  Thanks.
  23. > rmurphy@minerva.cis.yale.edu
  24.  
  25. I don't know if this is the only answer, but..
  26.  
  27. It is to do with the way numbers are stored on different platforms.. if
  28. you write a c program that uses an integer, there is no guarantee that
  29. it will take up the same amount of storage on the two machines.. e.g.
  30. if you do a sizeof(int), you could get different answers..  this means
  31. that if you take an integer value created on one machine and send it to
  32. the other one, it may well be meaningless as far as the other program 
  33. is concerned because it isn't in the right format for what it thinks of
  34. as an integer.
  35.  
  36. when I've been doing network programming to send numbers about, I've 
  37. usually done it by converting numbers to strings, and converting them 
  38. back at the other end..  then the platform is unimportant.
  39.  
  40. -- 
  41. :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
  42. :: Adrian Parker  adrian@willen.demon.co.uk  Quondam Ltd ::
  43. :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
  44.